<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sys="">
<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>KISS</title>
  <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
  <link rel="stylesheet" th:href="@{/font-awesome/css/font-awesome.min.css}">
  <link rel="stylesheet" th:href="@{/css/main.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
	<!-- 头 -->
	<div class="layui-header header" >
	  <div class="layui-logo" style="font-weight: bold;font-size: 18px;color: #FFFFFF;">KISS</div>
	   <!-- 顶部右侧菜单 -->
	    <ul class="layui-nav top_menu layui-nav-tree" lay-shrink="all" style="float: right;">
			<li class="layui-nav-item" id="userInfo">
				<a href="javascript:;"><cite><span style="font-size: 16px;font-weight: bold;" th:text="${user?.realname}">zxy</span></cite></a>
				<dl class="layui-nav-child">
					<dd><a href="javascript:;" onclick="userInfo()" ><i class="seraph icon-ziliao" data-icon="icon-ziliao"></i><cite>个人资料</cite></a></dd>
					<dd><a href="javascript:;" onclick="modifyPwd()"><i class="seraph icon-xiugai" data-icon="icon-xiugai"></i><cite>修改密码</cite></a></dd>
					<dd><a th:href="${web_root + '/user/logout.html'}" class="signOut"><i class="seraph icon-tuichu"></i><cite>退出</cite></a></dd>
				</dl>
			</li>
		</ul>
	  
	</div>
	
    <!-- 左菜单 -->
	<div id="main" class="layui-side" >
	  <div class="layui-side-scroll">
	    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
	    <ul class="layui-nav layui-nav-tree" lay-filter="index-nav">
	      
	    </ul>
	    
	  </div>
	</div>
	
    <!-- 右侧内容 -->
	<div class="layui-body layui-form">
		<div class="layui-tab" lay-allowClose="true" lay-filter="index-tab" id="top_tabs_box">
			<!-- tab上导航 -->
			<ul class="layui-tab-title top_tab" id="top_tabs">
			</ul>
			<!-- tab内容 -->
			<div class="layui-tab-content clildFrame">
			</div>
		</div>
	</div>
	
  
</div>
<script type="text/javascript" th:src="@{/js/jquery-3.0.0.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.all.js}"></script>
<script type="text/javascript" th:src="@{/js/main.js}"></script>
<script type="text/javascript" th:src="@{/js/basic.js}"></script>
<script type="text/javascript" th:src="@{/js/echarts.min.js}"></script><script type="text/javascript" th:inline="javascript">
//将layui全部加载
var layer;
var element;
;!function(){
	layer= layui.layer;
	element= layui.element;
}();
$(function(){
	//加载目录
	// loadMenu();
	//重新加载nav的样式
	element.render('nav');
	
	//跳转第一个页面
	//  var id = $("#main .layui-nav-child a:first").attr("data-id");
	//  var name = $("#main .layui-nav-child a:first").attr("data-name");
	//  var url =web_root+ $("#main .layui-nav-child a:first").attr("data-url");
	//  $.LoadPage(id,name,url,null,null);
});

//用户信息
var user = [[${user}]];
//项目范文地址
var web_root = [[${web_root}]];
//用户其他js文件中获取
function getWeb_root(){
	return web_root;
}

//加载目录
function loadMenu(){
	var url = web_root+"/perm/rolePerm";
	$.OGet(url,{"user_id":user.id},function(data){
		if(data.code=='200'){
			
			//去除目录列表
			var list = data.data;
			var str = "";
			for(var i=0;i<list.length;i++){
				//过滤删除的目录
				if(!list[i]){
					continue;
				}
				//如果不是目录,跳过
				if(list[i].type=='item'){
					continue;
				}
				//表示为父菜单
				if(list[i].pid=='0'){
					if(i!=0){
						str += '</dl></li>'	
					}
					str += '<li class="layui-nav-item"><a href="javascript:;"  style="font-size: 16px;"><i class="'+list[i].icon+'"></i>&nbsp;&nbsp;'+list[i].name+'</a><dl class="layui-nav-child">';
				}else{
					str += '<dd><a href="javascript:;" data-id="'+list[i].id+'" data-name="'+list[i].name+'" data-url="'+list[i].url+'">'+list[i].name+'</a></dd>';
				}
				if(i==list.lenth-1){
					str += '</dl></li>';	
				}
			}
			
			$("#main .layui-nav-tree").html(str);
		}else{
			layer.msg(data.message);
		}
	});
}
//用户信息
function userInfo(){
	popup.dialog(web_root+"/user/userInfo.html",{"user_id":user.id},"用户信息");
}
//修改密码
function modifyPwd(){
	popup.dialog(web_root+"/user/password.html",{"user_id":user.id},"修改密码");
}

$(function(){
jQuery('#main .layui-nav-item>a').click(function() {
    var parent = jQuery(this).parent();
    if(parent.hasClass("layui-nav-itemed")){
    	jQuery('#main .layui-nav-item').removeClass('layui-nav-itemed');
    	parent.addClass('layui-nav-itemed');
    }else{
  	  parent.removeClass('layui-nav-itemed');
    }
 });
});
</script>
</body>
</html> 